import axios from "axios";
export const CONF = {
  url: "https://m.maizuo.com/",
};

export const service = axios.create({
  baseURL: CONF.url,
  timeout: 5000,
});

service.interceptors.request.use(
  (conf) => {
    conf.headers["X-Client-Info"] =
      '{"a":"3000","ch":"1002","v":"5.2.1","e":"16659080323946224541499393","bc":"310100"}';
    conf.headers["X-Host"] = "mall.film-ticket.film.list";
    return conf;
  },
  (error) => {
    return Promise.reject(error);
  }
);

service.interceptors.response.use((res) => {
  if (res.status === 200) {
    return res.data;
  }
  return res;
});
